﻿using System.Windows.Controls;
using System.Windows.Input;
using DevExpress.Mvvm;
using EduAssess.Services;
using EduAssess.Views;

namespace EduAssess.ViewModels;

public class MainViewModel : BindableBase
{
    private readonly PageNavigationService _navigation;

    public Page CurrentPage { get; set; }

    public MainViewModel(PageNavigationService navigationService)
    {
        navigationService.OnPageChanged += page => CurrentPage = page;
        navigationService.Navigate(new StartPage());
        _navigation = navigationService;
    }

    public ICommand GoBack => new DelegateCommand(() => { _navigation.GoBack(); }, () => _navigation.CanGoBack);
}